package com.a85.wxhelper.http;

import android.support.annotation.NonNull;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * @author hejiangwei
 * Created at 2018/7/17.
 */
public abstract class BaseObserver<T> implements Observer<T> {
    protected abstract void onSucceed(T t);

    public abstract void onFail(Throwable e);

    @Override
    public void onSubscribe(@NonNull Disposable d) {}

    @Override
    public void onNext(T t) {
        onSucceed(t);
    }

    @Override
    public void onError(Throwable e) {
        onFail(e);
    }

    @Override
    public void onComplete() {

    }


}
